package com.nananren.shiyan8;

public abstract class Account {
    public boolean validate(String account, String password) {
        System.out.println(String.format("账号: %s", account));
        System.out.println(String.format("密码: %s", password));
        if ( account.equals("那男人") && password.equals("123456")) {
            return true;
        }else {
            return false;
        }
    }
    public abstract void calculateInterest();

    public void display() {
        System.out.println("显示利息！");
    }

    public void Handele(String account , String password) {
        if (!validate(account, password) ) {
            System.out.println("账户或Miami错误!");
            return;
        }
        calculateInterest();
        display();
    }
}
